package com.jwdf.uda.ui.adapter.item;

import com.jwdf.uda.bean.PbBean;

import java.util.ArrayList;
import java.util.List;

/**
 * 类说明：
 */
public class HomeRecommendItem {
    public PbBean.PbGuideSimple recommend;
    public int commentCount;
    public int likeCount;
    public int voteCount;

    public HomeRecommendItem(PbBean.PbGuideSimple recommend, int commentCount, int likeCount, int voteCount) {
        this.recommend = recommend;
        this.commentCount = commentCount;
        this.likeCount = likeCount;
        this.voteCount = voteCount;
    }

    public static HomeRecommendItem convert(PbBean.PbGuideSimple recommend) {
//        HomeRecommendItem item = new HomeRecommendItem(recommend, recommend.getCommentCount(), recommend.getLikeCount(), recommend.getVoteCount());
        HomeRecommendItem item = new HomeRecommendItem(recommend, recommend.getCommentCount(), recommend.getLikeCount(), 0);
        return item;
    }

    public static List<HomeRecommendItem> convert(List<PbBean.PbGuideSimple> recommendList) {
        List<HomeRecommendItem> items = new ArrayList<>();
        if (recommendList != null) {
            for (int i = 0; i < recommendList.size(); i++) {
                items.add(convert(recommendList.get(i)));
            }
        }
        return items;
    }
}
